#include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
	int a,b;
	while(scanf("%d %d",&a,&b)){
		int ans=0,c=0;
		int max=a>b?a:b;
		int min=a<b?a:b;
		while(min>0){
			c=(max%10+min%10+c)>9?1:0;
			ans=ans+1;
			min/=10;
			max/=10;
		}
		cout<<ans<<endl;
	}
	
}
